package com.shell.arouter.ui.activity

import androidx.activity.viewModels
import com.durian.base.utils.AndroidInfoUtils
import com.google.android.flexbox.FlexboxLayoutManager
import com.henanjianye.soon.communityo2o2.R
import com.shell.arouter.extend.toast
import com.shell.arouter.ui.viewmodel.MainViewModel
import kotlinx.android.synthetic.main.activity_main.*

/**
 * 说明：ActivityMain
 * <p/>
 * 作者：fanly
 * <p/>
 * 类型：Class
 * <p/>
 * 时间：2019-12-19 16:17
 * <p/>
 * 版本：version 1.0
 */
open class ActivityMain : ActivityCommon() {

    private val viewModel by viewModels<MainViewModel>()


    override fun onInitStart() {
        viewModel.adapter.setLifecycleOwner(this)
        rvItems.layoutManager = FlexboxLayoutManager(this)
        rvItems.adapter = viewModel.adapter
    }

    override fun onBackPressed() {
        super.onBackPressed()
    }

    override fun getRootViewResID(): Int {
        return R.layout.activity_main
    }

    override fun isShowTitleBar(): Boolean {
        return true
    }

    override fun isShowTitleBarBack(): Boolean {
        return false
    }

    override fun bindTitleBarText(): String? {
        return AndroidInfoUtils.appName() + "主页"
    }



}
